﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

public partial class UserControl_SupportOnline : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            using (Up1VNDataContext dc = new Up1VNDataContext())
            {
                var support = (from o in dc.SupportOnlines select o).ToList();
                if (support.Count > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.Append("<h3>");
                    foreach (var item in support)
                    {

                        if (item.SupportOnline_PhoneNo != "")
                        {
                            if (item.SupportOnline_PhoneType == (byte)1)
                                sb.Append("Hot Line: " + item.SupportOnline_PhoneNo + "<br />");
                            if (item.SupportOnline_PhoneType == (byte)2)
                                sb.Append("Telephone: " + item.SupportOnline_PhoneNo + "<br />");
                            if (item.SupportOnline_PhoneType == (byte)3)
                                sb.Append("Fax: " + item.SupportOnline_PhoneNo + "<br />");
                        }
                        if (item.SupportOnline_Nick != "")
                        {
                            if (item.SupportOnline_NickType == (byte)1)
                                sb.Append("Yahoo: " + item.SupportOnline_Nick + "<br />");
                            if (item.SupportOnline_NickType == (byte)2)
                                sb.Append("Skype: " + item.SupportOnline_Nick + "<br />");
                            if (item.SupportOnline_NickType == (byte)3)
                                sb.Append("Msn: " + item.SupportOnline_Nick + "<br />");
                        }
                    }
                    sb.Append("</h3>");
                    ltrSupport.Text = sb.ToString();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
}